<!-- block -->
            <div class="block">
              <div class="navbar navbar-inner block-header">
                <div class="muted pull-left">
					Historique des achats
					
				</div>
              </div>
              <div class="block-content collapse in">
                <div class="span12">
                    <table class="table table-condensed table-hover">
						<thead>
							<tr>
			                  <th>Date Opération</th>	
							  <th>Quantité</th>
							  <th>Fournisseur</th>
							  <th>Prix Achat TND</th>
							  <th>Prix Achat Devise</th>
							</tr>
						</thead>
						<tbody> 
							<?php
								$req = "SELECT * FROM st_attr_entree WHERE id_article=".$row->id_article." AND qte <> 0 ORDER BY date_add asc";
								$obj = new Mysql ();
								$resultHistory = mysql_query($req);
								$QteTotale=0;
								$QtexPrixDNT=0;
								$QtexPrixEURO=0;
								while($rowHistory=mysql_fetch_object($resultHistory)){
							?>
							<tr>
								<td><?php
											/*$dD = $rowHistory->date_add;
										    $datD =explode('/', $dD);
										    $dateD = $datD['1'].'/'.$datD['0'].'/'.$datD['2'];
											echo $dateD; */
											echo $rowHistory->date_add;
								 			 
								 ?></td>
					  			<td style="color:#d0343a;"><?php echo number_format($rowHistory->qte, 0, '', ' ') ?></td>					  			
					  			<td><?php 
					  			$f =mysql_query("SELECT * FROM st_att_fournisseur WHERE id_fournisseur=".$rowHistory->id_fournisseur."");
					  			$f_m = mysql_fetch_object($f);
					  			echo $f_m->raison_social; ?></td>
						  	<?php
								$euroPrix =  $rowHistory->prix * 0.443;
								$dinarPrix= $rowHistory->prix;
						 	?>
							  <td>
							  <?php echo  number_format($dinarPrix, 3, '.', ' ')." TND"?></td>
							  <?php
							  		
							  		 if (empty($rowHistory->id_devise)) 
							  		 {
							  			echo '<td> Fournisseur TUN </td>';
										
							  		} 
							  		else 
							  		{
							  		 
							  		$sqt = "select * from st_att_monnaie where id_monnaie ='".$rowHistory->id_devise."'";
                                    $restl = mysql_query($sqt);
                                    $d= mysql_fetch_array($restl);
									echo '<td>'. number_format($rowHistory->prix_en_devise, 2, '.', ' ') .' '.$d['nom_monnaie'].'</td>';
							  		}
							  		
                                    
                                    ?>

                            </tr>
							
							<?php
								$QteTotale += $rowHistory->qte;
								$QtexPrixDNT += ($rowHistory->qte*$dinarPrix);
								$QtexPrixEURO += ($rowHistory->qte*$euroPrix);
							} ?>
				  </tbody>
					</table>
                </div>
              </div>
            </div>
        	<!-- /block -->